import axios from '@/libs/api.request'

/**
 * 获取表格数据
 * @return {[type]}        [description]
 */
export const fetchTableData = params => {
  return axios.request({
    url: '/api/forecast/getMeterListPaged',
    method: 'get',
    params
  })
}
/**
 * 获取矩形方图数据
 * @return {[type]}        [description]
 */
export const fetchTreeMap = params => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterGasCalssCountByYear',
    method: 'get',
    params
  })
}

/**
 * desc: 获取k线图数据
 * param {type}
 * return: void
 */
export const fetchCenterTopCandData = params => {
  return axios.request({
    url: '/api/tableGas/getMeterGasByDays',
    method: 'get',
    params
  })
}

export const fetchQSFXData = params => {
  return axios.request({
    url: '/api/localDataMonth/getMeterDetailByDay',
    method: 'get',
    params
  })
}

export const fetchZQFXData = params => {
  return axios.request({
    url: '/api/gasLaw/getTrendAnalysis',
    method: 'get',
    params
  })
}

export const fetchEBarData = params => {
  return axios.request({
    url: '/api/tableGas/getGasCountByDay',
    method: 'get',
    params
  })
}

/**
 * 表具详情
 * @return {[type]}        [description]
 */
export const fetchMeterDetail = id => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterBeanByMeterId/' + id,
    method: 'get'
  })
}

export const fetchRYQGLData = params => {
  return axios.request({
    url: '/api/gasLaw/getRuleByMeterId',
    method: 'get',
    params
  })
}

export const fetchZZQQS = params => {
  return axios.request({
    url: '/api/gasLaw/getTrendAnalysisByPeriod',
    method: 'get',
    params
  })
}

/**
 * 保存信息
 * @return {[type]}        [description]
 */
export const saveParamsByMeterId = data => {
  return axios.request({
    url: '/api/gasLaw/insertGasLawParam',
    method: 'post',
    data
  })
}

export const fetchQNYQFX = params => {
  return axios.request({
    url: '/api/gasMonitoring/getZeroGasTrend',
    method: 'get',
    params
  })
}
